<template>
  <avue-crud ref="crud" :option="option" :data="data" @row-update="rowUpdate" @row-save="rowSave">
    <template slot-scope="{ row, index }" slot="menu">
      <el-button type="text" size="small" @click="rowCell(row, index)">{{ row.$cellEdit ? '保存' : '修改' }}</el-button>
    </template>
  </avue-crud>
</template>

<script>
import { option } from '@/option/tenant/supplier/score-info'
export default {
  name: 'ScoreInfo',
  data() {
    return {
      data: [
        {
          id: 0,
          projectName: '22',
          projectContent: 'asdasd4',
          maxScore: 10,
          minScore: 2,
          score: 0,
          rater: 'xxx',
          remark: 'ss'
        },
        {
          id: 1,
          projectName: 'sd',
          projectContent: 'asda2',
          maxScore: 10,
          minScore: 2,
          score: 0,
          rater: 'xxx',
          remark: 'ss'
        }
      ],
      option: option.call(this)
    }
  },
  methods: {
    rowCell(row, index) {
      this.$refs.crud.rowCell(row, index)
    },
    rowSave(form, done) {
      this.$message.success('新增数据' + JSON.stringify(form))
      done()
    },
    rowUpdate(form, index, done) {
      this.$message.success('编辑数据' + JSON.stringify(form) + '数据序号' + index)
      done()
    }
  }
}
</script>

<style></style>
